#include <iostream>


using namespace std;


void CostOfRaisingAChild()
{
	int children;
	int startAge;
	int endAge, difference;
	double childCare, grocery, clothing, gifts, education, recreation, insurance, healthCare, misc ;
	double total1;
	double subtotal=0;
	int home, car;

	cout << "Welcome to our Annual Child Cost Calculator!" << endl << endl;
	cout << "This calculator will help you determine the cost of each child, as well" << endl << "as the sum of costs of all your children." << endl << endl; 
	cout << "Starting Age refers to your child's age(in years) for when you will or" << endl << "have started paying costs for your child." << endl;
	cout << "Ending Age refers to the age when you will no longer bear the expenses " << endl <<"for your child." << endl << endl;
	cout << "Note: If your child is under the age of 1, please enter 0 for Starting Age." << endl << endl;


	cout << "How many children would you like to calculate the cost for?: ";
	cin >> children;
	cout << endl << endl;

	if( children == 0)
	{
		cout << "You have no kids! You have $0 in child expenses! Go away!" << endl <<endl; 
	}

	for (int i =0; i+1 <= children; i++)
	{
		cout << "Let's calculate the cost of "<< "child "<< i+1 << ":"<< endl <<endl;
		cout << "Enter your child's Starting Age(in years): ";
		cin >> startAge;

		cout << "Enter your child's age Ending Age(in years):";
		cin >> endAge;

		difference = endAge - startAge;

		cout << endl;
		cout << "How much are the annual Child Care expenses for this child? : $";
		cin >> childCare;
		cout << "How much are the annual grocery expenses for this child? : $";
		cin >> grocery;
		cout << "How much are the annual clothing expenses for this child? : $";
		cin >> clothing;
		cout << "How much are the annual gift expenses for this child? : $";
		cin >> gifts;
		cout << "How much are the annual education expenses for this child? : $";
		cin >> education;
		cout << "How much are the annual recreation expenses for this child? : $";
		cin >> recreation;
		cout << "How much are the annual additional insurance expenses for this child? : $";
		cin >> insurance;
		cout << "How much are the annual health care expenses for this child? : $";
		cin >> healthCare;

		cout << "Enter any miscellaneous expenses for this child (enter 0 if there are none): $"; 
		cin >> misc;

		total1 = (childCare + grocery + clothing + gifts + education + recreation + insurance + healthCare + misc)*difference;
		cout << "Individual Annual Total Cost of Child " << i+1 << " is: $" << total1 << endl << endl;
		subtotal += total1;
	}

	if (children !=0)
	{
		cout << "-------------------------------------------------" << endl << endl; 
		cout << "Other Expenses" << endl << endl; 
		cout << "What are the annual expenses for having a bigger home? : $";
		cin >> home;
		cout << "What are the annual expenses for having a bigger car? : $";
		cin >> car;
		cout << endl << endl;

		cout << "Total Cost of " << children << " children is: $" << subtotal + home + car << endl <<endl;
	}

	cout << "Thank you for using our Annual Child Cost Calculator!" << endl << endl;

	system("pause");
}